filelist = {"1118-meas-packets-initset.evl":['dest', 'nodeid', 'drift_idx', 'driftError', 'pos_drift', 'syncdiff'], \
            "1129-reduced-initset.evl":['dest', 'origin', 'nodeid']}

for key in filelist.keys():
    print "Current file is " + key
    currentfile = key
    argument = filelist[key]
    d = {}
    for i in range(len(argument)):
        d[argument[i]] = []

    f = open(currentfile,'r')
    for line in f:
        for i in range(len(argument)):
         g = line.split("\t")
         for item in g:
           h = item.split("::")
           if h[0]==argument[i]:
               try:
                 d[argument[i]].index(int(h[1]))
               except ValueError:
                 try:
                   if len(d[argument[i]]) < 15:
                      d[argument[i]].append(int(h[1]))
                   else:
                     if int(h[1]) < min(d[argument[i]]) or int(h[1]) > max(d[argument[i]]):
                       d[argument[i]].append(int(h[1]))
                 except ValueError:
                   if len(d[argument[i]]) < 15:
                      d[argument[i]].append(float(h[1]))
                   else:
                     if float(h[1]) < min(d[argument[i]]) or float(h[1]) > max(d[argument[i]]):
                       d[argument[i]].append(float(h[1]))
        
    for i in range(len(argument)):  
        d[argument[i]].sort()
        print argument[i] + " : " + str(d[argument[i]])
